home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7220 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: crl9.crl.com!not-for-mail
  2. From: sammy@crl.com (Samuel McGrath)
  3. Newsgroups: comp.lang.pascal.misc,comp.lang.pascal.borland,comp.programming,comp.lang.misc,comp.lang.c,comp.lang.c++
  4. Subject: Re: Writing an expression evaluator
  5. Followup-To: comp.lang.pascal.misc,comp.lang.pascal.borland,comp.programming,comp.lang.misc,comp.lang.c,comp.lang.c++
  6. Date: 22 Feb 1996 01:37:01 -0800
  7. Organization: CRL Dialup Internet Access    (415) 705-6060  [Login: guest]
  8. Message-ID: <4ghdft$24t@crl9.crl.com>
  9. References: <311FEBD8.7305@cnj.digex.net> <sundial.2346.02382731@primenet.com>
  10. NNTP-Posting-Host: crl9.crl.com
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. No no no, you're doing this all wrong!  The correct way to write an 
  14. expression evaluator is with QBASIC.  Observe:
  15.  
  16.     PRINT "Enter an expression:"
  17.     INPUT E$
  18.     OPEN "TEMP.BAS" FOR OUTPUT AS #1
  19.     PRINT #1, "PRINT " + E$
  20.     PRINT #1, "RUN "+CHR$(34)+"THISPROG.BAS"+CHR$(34)
  21.     CLOSE #1
  22.     RUN "TEMP.BAS"
  23.  
  24. Jeez guys, I don't know why your complicating the issue with things like 
  25. parsing and recursion.  Go figure.
  26.  
  27. -Sam McGrath
  28.  
  29. [insert smiley face here.  I refuse to.]
  30.